Trees | Indices | Toggle frames |
---|
Simple displayable text.
This is a convenience class for rendering strings of text. It takes care of caching the vertices so the text can be rendered every frame with little performance penalty.
Text can be word-wrapped by specifying a width to wrap into. If the width is not specified, it gives the width of the text as laid out.
Deprecated: Use pyglet.text.Label.
__init__(self,
font,
text='
' ,
x=0,
y=0,
z=0,
color=( 1, 1, 1, 1) ,
width=None,
halign=' left ' ,
valign=' baseline ' )
Create displayable text.
|
|
draw(self) |
font | |
color | |
z | |
float |
width
Width of the text.
|
float |
height
Height of the text.
|
str |
text
Text to render.
|
str |
halign
Horizontal alignment of the text.
|
str |
valign
Vertical alignment of the text.
|
int |
leading
Vertical space between adjacent lines, in pixels.
|
int |
line_height
Vertical distance between adjacent baselines, in pixels.
|
int |
x
X coordinate of the text
|
int |
y
Y coordinate of the text
|
LEFT =
|
|
CENTER =
|
|
RIGHT =
|
|
BOTTOM =
|
|
BASELINE =
|
|
TOP =
|
'
'
,
x=0,
y=0,
z=0,
color=(
1,
1,
1,
1)
,
width=None,
halign='
left
'
,
valign='
baseline
'
)
Width of the text.
When set, this enables word-wrapping to the specified width. Otherwise, the width of the text as it will be rendered can be determined.
Height of the text.
This property is the ascent minus the descent of the font, unless there is more than one line of word-wrapped text, in which case the height takes into account the line leading. Read-only.
Text to render.
The glyph vertices are only recalculated as needed, so multiple changes to the text can be performed with no performance penalty.
Trees | Indices | Toggle frames |
---|
Generated by Epydoc 3.0beta1 on Thu Dec 31 17:58:18 2009 | http://epydoc.sourceforge.net |